const http = require('../utils/http.js');

// 获取最新n条优惠券
const getLatestCoupon = (top) => {
    return http.request('GET', `/Coupon/${top}/list`)
}

// 领取优惠券
const receiveCoupon = (data) => {
    return http.request('POST', `/Coupon/receive`, data)
}

// 获取用户优惠券
const getMyCoupons = (params) => {
    return http.request('GET', `/Coupon/currentUser?enum=${params}`)
}

module.exports = {
    getLatestCoupon,
    receiveCoupon,
    getMyCoupons
}